Function: generateId(domElement) Shorthand: genId(domElement) Description: Programmatically generates a unique ID. Returns: String, domElement, or $A object if chained. Note: If no DOM element is specified, generateId() will return a unique ID string. If a DOM element is specified however, then domElement.id will be set to the unique ID before the DOM element is returned. Example: // Create a unique ID string var idString = $A.generateId(); // Set a unique ID on an element var myElement = $A.generateId(domElement); // Or the same using chaining // Set a unique ID on an element var myChain = $A(domElement).generateId(); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();